<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-for</title>
</head>
<body>
    <div id="app">
        <!--遍历数组-->
        <table border="1px" cellspacing="0px" cellpadding="10px">
            <tr v-for="(user,index) in users">
                <td v-text="index"></td>
                <td v-text="user.name"></td>
                <td v-text="user.gender"></td>
                <td v-text="user.age"></td>
            </tr>
        </table>

        <br>
        <!--对象的遍历-->
        <table border="1px" cellspacing="0px" cellpadding="10px">
            <tr v-for="(v,k,i) in user">
                <td v-text="i"></td>
                <td v-text="k"></td>
                <td v-text="v"></td>
            </tr>
        </table>
    </div>

    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        var vm=new Vue({
            el:"#app",
            data:{
                users:[
                    {name:'柳岩',gender:'女',age:21},
                    {name:'有哥',gender:'男',age:30},
                    {name:'范冰冰',gender:'女',age:24},
                    {name:'刘亦菲',gender:'女',age:18},
                    {name:'古力娜扎',gender:'女',age:25}
                ],
                user:{name:'柳岩',gender:'女',age:21},
            }
        })
    </script>
</body>
</html>